package cn.itcast.test;/*
 *
 * @author 陈粒
 * @version 创建时间：2021/7/9 19:55
 */

import cn.itcast.junit.Calculator;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class Calculatortest {
    @Before
    public void init(){
        System.out.println("init....");
    }
    @After
    public void close(){
        System.out.println("close....");
    }
    @Test
    public void testadd() {
        Calculator c = new Calculator();
        int result=c.add(1,2);
        System.out.println(result);
        Assert.assertEquals(3,result);
    }
    @Test
    public void testsub(){
        Calculator c=new Calculator();
        int result=c.sub(1,2);
        System.out.println(result);
        Assert.assertEquals(-1,result);
    }
}
